const color = ["#39FFA2", "#FF3E3D", "#00A2FF", "#FA8F3C", "#9254DE", "#F759AB", "#EAAC01", "#E55C02", "#2EB5EB", "#67C901", "#33EE97", "#33EE97", "#347DC9"];

const gridNum = "5%"

// 工单完成情况 近7天
export const onOption1 = () => {
  return {
    color: ["#39FFA2", "#FF3E3D"],
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "shadow",
      },
    },
    grid: {
      left: gridNum,
      right: gridNum,
      bottom: gridNum,
      containLabel: true,
    },
    legend: {
      type: "scroll",
      data: ["已完工", "未完工"],
      textStyle: {
        color: "#fff",
      },
    },
    xAxis: {
      type: "category",
      data: ["2023-03-24", "2023-03-25", "2023-03-26", "2023-03-27", "2023-03-28", "2023-03-29", "2023-03-30"],
      axisLabel: {
        // interval: 0,
        textStyle: {
          color: "#fff",
        },
      },
    },
    yAxis: {
      type: "value",
      minInterval: 1,
      name: "单位(个)",
      nameTextStyle: {
        color: "#fff",
        fontWeight: "bold",
      },
      nameGap: 20,
      axisLabel: {
        textStyle: {
          color: "#fff",
        },
      },
    },
    series: [
      {
        name: "已完工",
        type: "bar",
        barMaxWidth: 14,
        stack: "总量",
        data: [65, 22, 42, 66, 65, 72, 0],
      },
      {
        name: "未完工",
        type: "bar",
        barMaxWidth: 14,
        stack: "总量",
        data: [9, 7, 10, 12, 8, 6, 0],
      },
    ],
  };
};

// 发帖情况分布 近7天
export const onOption2 = () => {
  return {
    color,
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "shadow",
      },
    },
    legend: {
      type: "scroll",
      data: ["2022年", "2023年"],
      textStyle: {
        color: "#fff",
      },
    },
    grid: {
      left: gridNum,
      right: gridNum,
      bottom: gridNum,
      containLabel: true,
    },
    xAxis: {
      type: "category",
      data: ["a", "b", "c", "d", "e", "f", "g"],
      axisLabel: {
        textStyle: {
          color: "#fff",
        },
      },
    },
    yAxis: {
      name: "单位（m³)",
      axisLabel: {
        textStyle: {
          color: "#fff",
        },
      },
      axisLine: {
        lineStyle: {
          color: '#fff',
        }
      }
    },
    series: [
      {
        type: "bar",
        name: "2022年",
        data: [65, 22, 42, 66, 65, 72, 80],
      },
      {
        type: "bar",
        name: "2023年",
        data: [65, 22, 42, 66, 65, 72, 80],
      },
    ],
  };
};

// 物业考情打卡人数 近7天
export const onOption3 = () => {
  return {
    tooltip: {
      trigger: 'axis'
    },
    legend: {
      data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine'],
      textStyle: {
        color: "#fff"
      }
    },
    grid: {
      left: gridNum,
      right: gridNum,
      bottom: gridNum,
      containLabel: true,
    },
    xAxis: {
      type: 'category',
      boundaryGap: false,
      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
      axisLabel: {
        textStyle: {
          color: "#fff",
        },
      },
    },
    yAxis: {
      type: 'value',
      axisLabel: {
        textStyle: {
          color: "#fff",
        },
      },
    },
    series: [
      {
        name: 'Email',
        type: 'line',
        stack: 'Total',
        data: [120, 132, 101, 134, 90, 230, 210]
      },
      {
        name: 'Union Ads',
        type: 'line',
        stack: 'Total',
        data: [220, 182, 191, 234, 290, 330, 310]
      },
      {
        name: 'Video Ads',
        type: 'line',
        stack: 'Total',
        data: [150, 232, 201, 154, 190, 330, 410]
      },
      {
        name: 'Direct',
        type: 'line',
        stack: 'Total',
        data: [320, 332, 301, 334, 390, 330, 320]
      },
      {
        name: 'Search Engine',
        type: 'line',
        stack: 'Total',
        data: [820, 932, 901, 934, 1290, 1330, 1320]
      }
    ]
  };
};

